/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bash.carrep.ui;

import com.bash.carrep.ui.datasource.CategPMContainer;
import com.vaadin.ui.Table;

/**
 *
 * @author p.bashizi
 */
public class CategPmTable extends Table{

    public CategPmTable(CarrepApplication app) {
        setSizeFull();
		setContainerDataSource(CategPMContainer.getData());

		setVisibleColumns(CategPMContainer.NATURAL_COL_ORDER);
		setColumnHeaders(CategPMContainer.COL_HEADERS_FR);

		setColumnCollapsingAllowed(true);
		setColumnReorderingAllowed(true);

		/*
		 * Make table selectable, react immediatedly to user events, and pass
		 * events to the controller (our main application)
		 */
		setSelectable(true);
		setImmediate(true);
		addListener((ValueChangeListener) app);
		/* We don't want to allow users to de-select a row */
		setNullSelectionAllowed(false);
    }
    
}
